package compare;

import java.util.Arrays;

public class Test {
    public static void main(String[] args) {
        Student stu1=new Student("铭哥",18);
        Student stu2=new Student("郝文雪",20);
        Student stu3=new Student("米乐",20);
        Student[] students={stu1,stu2,stu3};
        AgeSec ageSec=new AgeSec();
        Arrays.sort(students,ageSec);//将比较器传给排序方法
        System.out.println(Arrays.toString(students));

    }
}
